aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/groups/[groupId]/@modal/expenses/create/page.tsx
blob: 93cc413f22116d0bea663475ff2c4ca3e9df06a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { ExpenseModal } from '@/app/groups/[groupId]/@modal/expense-modal'
import { ExpenseForm } from '@/components/expense-form'
import { getGroup } from '@/lib/api'
import { Metadata } from 'next'
import { notFound } from 'next/navigation'

export const metadata: Metadata = {
  title: 'Create expense',
}

export default async function ExpensePage({
  params: { groupId },
}: {
  params: { groupId: string }
}) {
  const group = await getGroup(groupId)
  if (!group) notFound()

  return (
    <ExpenseModal title="Create expense">
      <ExpenseForm group={group} />
    </ExpenseModal>
  )
}